Matthias Clasen [Tue, 20 May 2014 00:45:42 +0000 (20:45 -0400)]
Docs: Minor changes
Matthias Clasen [Tue, 20 May 2014 00:17:12 +0000 (20:17 -0400)]
Document gtk_gesture_set_state
Matthias Clasen [Tue, 20 May 2014 00:10:48 +0000 (20:10 -0400)]
docs: gtk_gesture_cancel_sequence was made private
Matthias Clasen [Tue, 20 May 2014 00:00:31 +0000 (20:00 -0400)]
docs: More GtkEventController removal
Matthias Clasen [Mon, 19 May 2014 23:37:16 +0000 (19:37 -0400)]
docs: GtkEventController was dropped from public api
Carlos Garnacho [Mon, 19 May 2014 17:58:54 +0000 (19:58 +0200)]
paned: Use GtkGesture to handle handle dragging
Dragging is all handled by a GtkGesturePan now, matching the
paned orientation.
On touch events, a wider area is listened for, so touch events
don't need to be as accurate to initiate dragging, if no dragging
is truly initiated in this case, events are just forwarded for
child widgets to handle.
Carlos Garnacho [Mon, 19 May 2014 14:08:56 +0000 (16:08 +0200)]
switch: Use GtkGesture to handle input events
A pan gesture is used to handle switch dragging, which is only triggered
by horizontal panning movements. A multipress gesture handles the cases
where clicking without dragging happens, just toggling the switch.
Matthias Clasen [Fri, 16 May 2014 23:44:43 +0000 (19:44 -0400)]
inspector: Add more complete gesture support
Add a dedicated tab that shows how gestures are grouped,
and allows changing the propagation phase.
Matthias Clasen [Fri, 16 May 2014 18:27:58 +0000 (14:27 -0400)]
inspector: Minimal support for gestures
We're just showing them as objects in the tree, for now.
Matthias Clasen [Fri, 16 May 2014 17:14:13 +0000 (13:14 -0400)]
Add back a private api to list controllers
This will let us show them in the inspector.
Carlos Garnacho [Fri, 16 May 2014 17:59:31 +0000 (19:59 +0200)]
texthandle: Make a bigger hit area around texthandles
The hit area now extends to all sides around the handle, instead
of just towards where the text is. This makes it easier to grab
handles once shown.
Carlos Garnacho [Fri, 16 May 2014 17:35:08 +0000 (19:35 +0200)]
gesture: Declare GtkGesture:window as an object property
Carlos Garnacho [Fri, 16 May 2014 16:58:11 +0000 (18:58 +0200)]
widget: 3-way merge ate my g_object_ref()
Move it to the right place.
Carlos Garnacho [Fri, 16 May 2014 16:35:45 +0000 (18:35 +0200)]
scrolledwindow: Handle directional cancellation if there is a single scroll direction
A pan gesture is optionally attached if there is only one scrolling direction, the pan
gesture orientation is changed so movements tangential to the scroll direction get
scrolling cancelled (The pan gesture is automatically denied when that happens, and
that state change spreads to the others gestures in the group). If the pan direction
happens in the expected directions, no cancellation happens, and scrolling eventually
takes place.
Carlos Garnacho [Fri, 16 May 2014 16:34:15 +0000 (18:34 +0200)]
widget: remove check on whether the controller was already added
Multiple calls are supposedly allowed to change the phase (although
unlikely to happen), so remove the g_return_if_fail() checking whether
the controller was already added.
Carlos Garnacho [Fri, 16 May 2014 16:33:05 +0000 (18:33 +0200)]
pan: Remove wrong check
From the very early days where there were a NONE=0 GtkPanOrientation
value. This makes vertical pan operations work as expected.
Carlos Garnacho [Fri, 16 May 2014 15:46:12 +0000 (17:46 +0200)]
entry: Ensure the cursor text handle is shown after touching to reposition cursor.
Carlos Garnacho [Fri, 16 May 2014 15:38:28 +0000 (17:38 +0200)]
popover: Hide widget first when disposing
In order to ensure invariants are kept.
Carlos Garnacho [Fri, 16 May 2014 15:36:59 +0000 (17:36 +0200)]
entry: Obey implementations' frame when placing handles/popovers around
Y=0 was assumed in a few places, not necessarily right on eg. vertical
spinbuttons.
Carlos Garnacho [Fri, 16 May 2014 15:35:53 +0000 (17:35 +0200)]
entry: Improve touch popover interaction
Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)
Carlos Garnacho [Fri, 16 May 2014 15:32:59 +0000 (17:32 +0200)]
textview: Show the magnifier popover a bit farther from the touch position
Somewhat arbitrary at the moment, would be nice to have minimal units
support for this, or at least hidpi support.
Carlos Garnacho [Fri, 16 May 2014 15:27:42 +0000 (17:27 +0200)]
textview: Improve touch popover interaction
Presses alternatively show and dismiss the popover, the popover is still
always shown invariably after any dragging happens (either text selection,
or dragging a text handle)
Carlos Garnacho [Thu, 15 May 2014 13:03:18 +0000 (15:03 +0200)]
entry: Use gestures to handle pointer/touch events
Similarly to GtkTextView, a GtkGestureMultiPress gesture handles
button/touch presses to initiate one selection mode or other, and
a GtkGestureDrag is used to handle text selection and DnD checks.
The code from button press/release, motion, and grab_notify handlers
has been shuffled into the actions triggered by those gestures.
Carlos Garnacho [Wed, 14 May 2014 11:05:41 +0000 (13:05 +0200)]
spinbutton: Attach "swipe to spin" controllers to the bubble phase
It is unnecessary to have those process events manually, just attach
those to the bubble phase.
Carlos Garnacho [Wed, 14 May 2014 10:56:16 +0000 (12:56 +0200)]
colorplane: Fully port to GtkGesture
A GtkGestureDrag is used for color selection, removing also the
need to track the pointer state in widget data. The GDK grab performed
just to set the crosshair cursor has been replaced by a call
to gdk_window_set_device_cursor(), which will be unset if the
drag operation is finished, or cancelled due to the implicit grab
being broken.
Carlos Garnacho [Wed, 14 May 2014 10:53:54 +0000 (12:53 +0200)]
gdk: Lookup both device and global cursor when checking up the hierarchy
When the pointer cursor is updated on CSW, lookup for either a device
cursor, or a global one. It would previously lookup for windows with
a global cursor, and then check if it had a device cursor, which would
skip windows with only device cursors set, and unexpectedly set the
global cursor.
Carlos Garnacho [Mon, 12 May 2014 17:52:35 +0000 (19:52 +0200)]
button: Make multipress gesture exclusive
We only want actions to be triggered by a single sequence there,
so buttons trigger no actions on further simultaneous touches
happening.
Carlos Garnacho [Mon, 12 May 2014 17:50:26 +0000 (19:50 +0200)]
gesturesingle: Add an "exclusive" boolean property
All "exclusive" gestures listen for either pointer events, or
"pointer emulating" touch events, so only a single sequence at
a time can make these run.
Carlos Garnacho [Mon, 12 May 2014 17:12:27 +0000 (19:12 +0200)]
button: Use GtkGestureMultiPress for signal emission
It is now useful for that purpose with a ::release signal, so replace
the custom GtkGestureSingle with one of these.
Carlos Garnacho [Mon, 12 May 2014 17:11:53 +0000 (19:11 +0200)]
drag: Allow gtk_gesture_get_start_point/offset() to be called on ::drag-end
Carlos Garnacho [Mon, 12 May 2014 15:02:03 +0000 (17:02 +0200)]
multipress: Add matching ::released signal
This signal will always be paired with a ::pressed signal, unless
the sequence is cancelled, or the controller is reset. the n_press
argument in the signal always matches the ::press signal one, even
if GtkGestureMultiPress::stopped was emitted in between.
Carlos Garnacho [Mon, 12 May 2014 14:56:41 +0000 (16:56 +0200)]
multipress: Protect against fleeting touches mistriggering events
The current sequence (as per gtk_gesture_single_get_current_sequence)
is used to find out the coordinates. And only emit ::pressed if the
gesture began through a GDK_BUTTON_PRESS/TOUCH_BEGIN (eg. not due to
an extra touch being lifted)
Carlos Garnacho [Sat, 10 May 2014 18:59:55 +0000 (20:59 +0200)]
textview: Set up controllers on the GTK_PHASE_TARGET propagation phase
This way events are managed by gestures in the event handlers themselves,
respecting the execution order already assumed by subclasses around.
Carlos Garnacho [Sat, 10 May 2014 18:52:17 +0000 (20:52 +0200)]
widget: Hook GTK_PHASE_TARGET controllers to the default event handlers
Just call the controllers on that phase if the default widget handlers
are run.
For compatibility reasons, in the touch event handler, let the pointer
emulating touch be transformed to a pointer event as usual, in order to
have widget handlers a chance to run at all. If they have to be managed
by a controller in that phase, it'll have to be through the default pointer
event handlers.
Carlos Garnacho [Sat, 10 May 2014 18:50:23 +0000 (20:50 +0200)]
gesture: Add GTK_PHASE_TARGET
This phase is meant to run in the default widget handlers, as opposed
to externally as in the bubble/capture phase. This will be most usually
the expected phase for every controller replacing code in event handlers
in GTK+, just so invocation and triggering order is kept unaltered.
Carlos Garnacho [Sat, 10 May 2014 18:46:47 +0000 (20:46 +0200)]
gesture: Handle GdkEventGrabBroken
That may happen separately from grab-notify, and also due to external
reasons, so ensure all sequences are cancelled if a grab is taken
in some GdkWindows that would obscure events on the controller.
Matthias Clasen [Fri, 9 May 2014 23:24:27 +0000 (19:24 -0400)]
GtkColorSwatch: Use gesture for button events too
Matthias Clasen [Fri, 9 May 2014 22:55:48 +0000 (18:55 -0400)]
GtkWindow: Only use a multipress gesture for toplevels
There is no point in creating and attaching this gesture
for override-redirect windows, so don't do it.
Matthias Clasen [Fri, 9 May 2014 19:53:27 +0000 (15:53 -0400)]
Be careful about the list of event controllers
We can end up with _gtk_widget_remove_controller getting called
while we are iterating over the list in _gtk_widget_run_controllers.
To avoid trouble, only mark the event controller as dead by
setting data->controller to NULL, and defer the actual freeing
and list manipulation to the loop in _gtk_widget_run_controllers.
Update other places that operate on controllers to handle
data->controller being NULL.
Carlos Garnacho [Fri, 9 May 2014 11:19:12 +0000 (13:19 +0200)]
textview: Convert gestures' coordinates to text window ones
And make some code shared between multipress/drag gesture.
Carlos Garnacho [Thu, 8 May 2014 14:28:49 +0000 (16:28 +0200)]
textview: Use GtkGestureDrag for text selection/DnD
remaining code in button press/release, motion notify, and grab
notify handlers has been shuffled to be managed by this gesture.
Carlos Garnacho [Wed, 7 May 2014 11:15:30 +0000 (13:15 +0200)]
textview: Use GtkGestureMultiPress for click handling
The button press handler is no longer necessary, and most of its
code has been shuffled into the GtkGestureMultiPress::pressed
handler.
Carlos Garnacho [Wed, 7 May 2014 17:08:50 +0000 (19:08 +0200)]
widget: tighten the conditions at which a press event is emulated
Make it really sure that the event is only emitted after every gesture
that consumed the button press is done with the sequence.
The event must only be emulated if a gesture in the capture phase happened
to consume the event, be cancelled, and
Carlos Garnacho [Wed, 7 May 2014 17:06:42 +0000 (19:06 +0200)]
widget: Fix gesture event handler retval for bubbled events
Do not clobber the return value if the regular event handler happens
to return FALSE, even if the gesture meant to consume the event.
Carlos Garnacho [Wed, 7 May 2014 09:18:00 +0000 (11:18 +0200)]
gesture: Prevent against sequence cancellation within gtk_gesture_set_state()
Sequences may be cancelled within the ::sequence-state-changed handler, which
would change the points hashtable as it's being iterated in this function. So
iterate over a list of sequences and let the hashtable change freely.
Carlos Garnacho [Tue, 6 May 2014 16:22:57 +0000 (18:22 +0200)]
gesture: Make gtk_gesture_get_last_update_time() private
Carlos Garnacho [Tue, 6 May 2014 16:18:10 +0000 (18:18 +0200)]
gesture: Remove gtk_gesture_get_last_event_type
Carlos Garnacho [Tue, 6 May 2014 16:10:32 +0000 (18:10 +0200)]
gesture: make gtk_gesture_cancel_sequence() private
Carlos Garnacho [Tue, 6 May 2014 16:04:25 +0000 (18:04 +0200)]
gesture: Make gtk_gesture_check() private
Carlos Garnacho [Tue, 6 May 2014 15:27:17 +0000 (17:27 +0200)]
dnd: Check on the right gesture sequence when starting the drag op
Carlos Garnacho [Tue, 6 May 2014 13:50:01 +0000 (15:50 +0200)]
gesture: Simplify gesture/widget interaction public API
The propagation phase property/methods in GtkEventController are gone,
This is now set directly on the GtkWidget add/remove controller API,
which has been made private.
The only public bit now are the new functions gtk_gesture_attach() and
gtk_gesture_detach() that will use the private API underneath.
All callers have been updated.
Carlos Garnacho [Tue, 6 May 2014 13:25:31 +0000 (15:25 +0200)]
widget: Keep a widget reference around _gtk_widget_run_controllers()
The widget may be destroyed within the loop, in reaction to the signals
sent by the controllers. Protect against that.
Carlos Garnacho [Tue, 6 May 2014 13:23:24 +0000 (15:23 +0200)]
gesture: Add explanatory note in GtkGesture::end
Explain that this signal may be triggered by an extra touch that causes
the gesture to surpass GtkGesture:n-points.
Carlos Garnacho [Tue, 6 May 2014 13:20:56 +0000 (15:20 +0200)]
gesture: Cancel sequences that make a gesture exceed the number of touches as they happen
This makes it possible to track those through gtk_gesture_handles_sequence(),
without guessing from last event type or sequence state.
Carlos Garnacho [Tue, 6 May 2014 12:12:13 +0000 (14:12 +0200)]
widget: Change slightly the gesture cancellation policy in a same widget
Within a widget, if a gesture accepts a sequence, it would previously
cancel every other gesture that not in the same group. Change this to
only cancelling gestures that previously claimed the gesture, and let
gestures with state=NONE for that sequence remain like that.
This enables late recognition of gestures, even on the presence of
another gesture group that was more eager at claiming the gesture.
One usecase is user-defined panning gestures on scrolledwindows,
if ::capture-button-press is TRUE (eg. the default), the gesture is
claimed early in order to consume the button press, but that would
tipically make every other gesture group deny the sequence. With
this change, the pan gesture can keep state=NONE, and later claim
the sequence for itself if the panning gesture is recognized.
Also, do not propagate state=DENIED to every gesture in the widget,
that was unintended.
Carlos Garnacho [Tue, 6 May 2014 09:43:31 +0000 (11:43 +0200)]
rotate: Ensure delta is between [0..2Ï€]
Carlos Garnacho [Tue, 6 May 2014 09:39:15 +0000 (11:39 +0200)]
pan: make the direction factor less narrow in v/h directions
Carlos Garnacho [Mon, 5 May 2014 12:21:36 +0000 (14:21 +0200)]
gesture: Handle GDK_TOUCH_CANCEL events
The wayland windowing backend emits such events for instance, so
have gestures cancel the sequence as those events get through.
Carlos Garnacho [Mon, 28 Apr 2014 10:53:36 +0000 (12:53 +0200)]
gesture: Protect against odd window hierarchies
If no match is found with the gesture widget when poking the event
window parents, bail out safely instead of falling in an infinite
loop. This was seen on Mutter.
Carlos Garnacho [Thu, 17 Apr 2014 11:05:11 +0000 (13:05 +0200)]
swipe: Don't emit ::swipe if there are still active touches
Avoids sending spurious signals when an extra touch happens.
Matthias Clasen [Tue, 6 May 2014 02:40:18 +0000 (22:40 -0400)]
Prevent subclassing of gestures
For now, at least. We do this by hiding the instance and
class structures in private headers.
Matthias Clasen [Fri, 2 May 2014 02:05:42 +0000 (22:05 -0400)]
GtkSpinButton: Don't leak the gestures
Matthias Clasen [Fri, 2 May 2014 02:00:01 +0000 (22:00 -0400)]
GtkWindow: Don't leak the gesture
Matthias Clasen [Fri, 2 May 2014 01:53:35 +0000 (21:53 -0400)]
GtkTreeView: Remove unused field
Matthias Clasen [Fri, 2 May 2014 01:01:33 +0000 (21:01 -0400)]
gtk3-demo: Don't leak the color chooser
Matthias Clasen [Fri, 2 May 2014 01:00:28 +0000 (21:00 -0400)]
GtkColorPlane: Actually add the long press gesture
This was missed because gtk_widget_remove_controller silently
does nothing on unowned controllers.
Matthias Clasen [Fri, 2 May 2014 00:58:13 +0000 (20:58 -0400)]
GtkButton: Don't leak the gesture
Matthias Clasen [Fri, 2 May 2014 00:26:40 +0000 (20:26 -0400)]
Forgotten file
Matthias Clasen [Fri, 2 May 2014 00:15:40 +0000 (20:15 -0400)]
GtkButton: Port to GtkGesture
Quick-and-dirty patch to use a GtkGestureSingle for both
button press/release and touch event handling.
Carlos Garnacho [Thu, 10 Apr 2014 11:56:55 +0000 (13:56 +0200)]
widget: remove GtkGesture-related signals
The utility of those signals is somewhat dubious now that there is
gtk_gesture_group(), so make that the only way to coordinate gestures.
The cooperation model offered by gtk_gesture_group() is flexible
enough,
Carlos Garnacho [Thu, 10 Apr 2014 11:46:03 +0000 (13:46 +0200)]
docs: Add missing GtkEventController functions
Carlos Garnacho [Thu, 10 Apr 2014 11:45:38 +0000 (13:45 +0200)]
widget: Add docs for GtkGesture-related API
Carlos Garnacho [Thu, 10 Apr 2014 11:45:19 +0000 (13:45 +0200)]
gesturesingle: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:45:06 +0000 (13:45 +0200)]
zoom: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:45:00 +0000 (13:45 +0200)]
swipe: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:44:49 +0000 (13:44 +0200)]
rotate: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:44:06 +0000 (13:44 +0200)]
pan: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:53 +0000 (13:43 +0200)]
multipress: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:41 +0000 (13:43 +0200)]
longpress: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:27 +0000 (13:43 +0200)]
drag: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:15 +0000 (13:43 +0200)]
gesture: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:01 +0000 (13:43 +0200)]
eventcontroller: doc fixes
Carlos Garnacho [Wed, 9 Apr 2014 16:29:48 +0000 (18:29 +0200)]
docs: Add missing controller/gesture docs
Carlos Garnacho [Wed, 9 Apr 2014 16:29:02 +0000 (18:29 +0200)]
pan: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:49 +0000 (18:28 +0200)]
zoom: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:43 +0000 (18:28 +0200)]
rotate: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:27 +0000 (18:28 +0200)]
swipe: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:20 +0000 (18:28 +0200)]
drag: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:12 +0000 (18:28 +0200)]
longpress: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:03 +0000 (18:28 +0200)]
multipress: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:50 +0000 (18:27 +0200)]
gesturesingle: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:42 +0000 (18:27 +0200)]
gesture: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:31 +0000 (18:27 +0200)]
eventcontroller: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:11 +0000 (18:27 +0200)]
enums: Add missing docs to controller/gesture enums
Carlos Garnacho [Tue, 8 Apr 2014 19:27:49 +0000 (21:27 +0200)]
Remove GtkPressAndHold
This is replaced by GtkGestureLongPress, and all its callers have
been updated to use the replacement.
Carlos Garnacho [Tue, 8 Apr 2014 19:27:08 +0000 (21:27 +0200)]
enums: Document GtkPropagationPhase
Carlos Garnacho [Tue, 8 Apr 2014 19:24:54 +0000 (21:24 +0200)]
spinbutton: increase/decrease value on upwards/downwards touch swipes
This is somewhat analogous to scroll events on pointer devices, the
greater the velocity, the faster the spinbutton spins.
Carlos Garnacho [Tue, 8 Apr 2014 19:21:56 +0000 (21:21 +0200)]
Add GtkGesturePan
This gesture reports events on horizontal/vertical panning gestures.
Carlos Garnacho [Tue, 8 Apr 2014 19:21:14 +0000 (21:21 +0200)]
range: Replace GtkPressAndHold with GtkGestureLongPress
Carlos Garnacho [Tue, 8 Apr 2014 19:19:46 +0000 (21:19 +0200)]
swipe: Add function to retrieve the current velocity
This can be used to fetch the current velocity on update(), as opposed
to swipe() which happens after the sequence is finished.